﻿@using KRM.Core
@{
    ViewBag.Title = "Refund Request";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
    var orderid = ViewBag.OrderID;
    tblKRMRefundRequest refundRequest = ViewBag.RefundRequest;
    var status = refundRequest != null ? refundRequest.RequestStatus : 0;
}
<script>
    $(document).ready(function() {
        var height = $(window).height() - @(status == 0 || status == 5 ? 180 : 120);
        $(".refundrequestcontent").css("height", height);
    })
</script>
<script src="~/js/jquery.MultiFile.js"></script>
<div style="display: none">@Html.Partial("Partial/_MessageResult")</div>
<input type="hidden" id="SelectedOrderId" value="@orderid"/>
<div style="padding: 10px">
    <fieldset style="margin-top: 0">
        <legend>Category</legend>
        <div class="row-fluid">
            <div class="span3">
                <label style="float: left; margin-right: 40px">
                    <input type="radio" class="cbcheck cbfullrefund" name="category" checked="checked" value="full"/>
                    Full Refund</label>
                <label>
                    <input type="radio" class="cbcheck cbpartialrefund" name="category" value="partial"/>
                    Partial Refund</label>
            </div>
            <div class="span6">
                <input type="button" class="btn btn-primary" value="Display Request" onclick="displayrefunrequest()" />
               @if (refundRequest!=null && refundRequest.RequestType == "Partial Refund")
               {
                    <input type="button" class="btn btn-primary "value="Add New Request" onclick="displayrefunrequest(0)" />
               }
            </div>
        </div>
    </fieldset>
    <div class="border-padding10">
        <div class="refundrequestcontent overflow-auto">
        </div>
    </div>
    @if (status == 0 || status == 5 || status == 1 || status == 2 || (refundRequest != null && refundRequest.RequestType == "Partial Refund" && status != 5 && status != 1 && status != 2))
    {
        <div class="border-padding10 text-right">
            <input type="button" class="btn btn-primary w100" value="Submit" onclick="submitrefund()" />
            <input type="button" class="btn btn-danger w100" value="Clear" style="margin: 0 10px" />
            <input type="button" class="btn w100" value="Cancel" onclick="window.close()" />
        </div>
    }
</div>
